<?php 
include_once("./core/config.php");
$mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
if (!$mysqli->set_charset("utf8mb4")) {printf("Error loading character set utf8: %s\n", $mysqli->error);}
if (isset($_POST['name']) && !empty($_POST['name'])){
	$name=$_POST['name'];
	$query=$mysqli->query("select id from tu where type='".$name."'  limit 0, 1");
	if($query->num_rows>0){
		$mysqli->query("update tu set  num=num+1 where type='".$name."'  ");
	}else{
		$mysqli->query("insert into tu(type,num,create_time) values('".$name."',1,'".date("Y-m-d H:i:s")."') ");
	}
}